This dataset contains the information on south-asian countries happiness report. It has the following indexes of happiness.

Life Ladder GDP Social support Healthy life expectancy at birth Freedom to make life choices Generosity Perception of corrouption Positive effect Negative effect

Approach:

 get the data from kaggle: https://www.kaggle.com/ajaypalsinghlo/world-happiness-report-2021
 Load the data in dataframe.
 Drop the year column from the dataset and taking average of the all other column.
 Create a list of South Asian countries and make another dataframe with those countries in it.
 Rank the data by coountries based on the indexes one by one.
 create a table and visualize the data using plotly.
In [5]:
In [6]:
Out[6]:
Country name year Life Ladder Log GDP per capita Social support Healthy life expectancy at birth Freedom to make life choices Generosity Perceptions of corruption Positive affect Negative affect
0 Afghanistan 2008 3.724 7.370 0.451 50.80 0.718 0.168 0.882 0.518 0.258
1 Afghanistan 2009 4.402 7.540 0.552 51.20 0.679 0.190 0.850 0.584 0.237
2 Afghanistan 2010 4.758 7.647 0.539 51.60 0.600 0.121 0.707 0.618 0.275
3 Afghanistan 2011 3.832 7.620 0.521 51.92 0.496 0.162 0.731 0.611 0.267
4 Afghanistan 2012 3.783 7.705 0.521 52.24 0.531 0.236 0.776 0.710 0.268
5 Afghanistan 2013 3.572 7.725 0.484 52.56 0.578 0.061 0.823 0.621 0.273
6 Afghanistan 2014 3.131 7.718 0.526 52.88 0.509 0.104 0.871 0.532 0.375
7 Afghanistan 2015 3.983 7.702 0.529 53.20 0.389 0.080 0.881 0.554 0.339
8 Afghanistan 2016 4.220 7.697 0.559 53.00 0.523 0.042 0.793 0.565 0.348
9 Afghanistan 2017 2.662 7.697 0.491 52.80 0.427 -0.121 0.954 0.496 0.371
In [7]:
Out[7]:
Index(['Country name', 'year', 'Life Ladder', 'Log GDP per capita',
       'Social support', 'Healthy life expectancy at birth',
       'Freedom to make life choices', 'Generosity',
       'Perceptions of corruption', 'Positive affect', 'Negative affect'],
      dtype='object')
In [8]:
Out[8]:
array(['Afghanistan', 'Albania', 'Algeria', 'Angola', 'Argentina',
       'Armenia', 'Australia', 'Austria', 'Azerbaijan', 'Bahrain',
       'Bangladesh', 'Belarus', 'Belgium', 'Belize', 'Benin', 'Bhutan',
       'Bolivia', 'Bosnia and Herzegovina', 'Botswana', 'Brazil',
       'Bulgaria', 'Burkina Faso', 'Burundi', 'Cambodia', 'Cameroon',
       'Canada', 'Central African Republic', 'Chad', 'Chile', 'China',
       'Colombia', 'Comoros', 'Congo (Brazzaville)', 'Congo (Kinshasa)',
       'Costa Rica', 'Croatia', 'Cuba', 'Cyprus', 'Czech Republic',
       'Denmark', 'Djibouti', 'Dominican Republic', 'Ecuador', 'Egypt',
       'El Salvador', 'Estonia', 'Ethiopia', 'Finland', 'France', 'Gabon',
       'Gambia', 'Georgia', 'Germany', 'Ghana', 'Greece', 'Guatemala',
       'Guinea', 'Guyana', 'Haiti', 'Honduras',
       'Hong Kong S.A.R. of China', 'Hungary', 'Iceland', 'India',
       'Indonesia', 'Iran', 'Iraq', 'Ireland', 'Israel', 'Italy',
       'Ivory Coast', 'Jamaica', 'Japan', 'Jordan', 'Kazakhstan', 'Kenya',
       'Kosovo', 'Kuwait', 'Kyrgyzstan', 'Laos', 'Latvia', 'Lebanon',
       'Lesotho', 'Liberia', 'Libya', 'Lithuania', 'Luxembourg',
       'Madagascar', 'Malawi', 'Malaysia', 'Maldives', 'Mali', 'Malta',
       'Mauritania', 'Mauritius', 'Mexico', 'Moldova', 'Mongolia',
       'Montenegro', 'Morocco', 'Mozambique', 'Myanmar', 'Namibia',
       'Nepal', 'Netherlands', 'New Zealand', 'Nicaragua', 'Niger',
       'Nigeria', 'North Cyprus', 'North Macedonia', 'Norway', 'Oman',
       'Pakistan', 'Palestinian Territories', 'Panama', 'Paraguay',
       'Peru', 'Philippines', 'Poland', 'Portugal', 'Qatar', 'Romania',
       'Russia', 'Rwanda', 'Saudi Arabia', 'Senegal', 'Serbia',
       'Sierra Leone', 'Singapore', 'Slovakia', 'Slovenia', 'Somalia',
       'Somaliland region', 'South Africa', 'South Korea', 'South Sudan',
       'Spain', 'Sri Lanka', 'Sudan', 'Suriname', 'Swaziland', 'Sweden',
       'Switzerland', 'Syria', 'Taiwan Province of China', 'Tajikistan',
       'Tanzania', 'Thailand', 'Togo', 'Trinidad and Tobago', 'Tunisia',
       'Turkey', 'Turkmenistan', 'Uganda', 'Ukraine',
       'United Arab Emirates', 'United Kingdom', 'United States',
       'Uruguay', 'Uzbekistan', 'Venezuela', 'Vietnam', 'Yemen', 'Zambia',
       'Zimbabwe'], dtype=object)
In [9]:
In [10]:
In [11]:
In [12]:
In [13]:
Out[13]:
Country name Life Ladder Log GDP per capita Social support Healthy life expectancy at birth Freedom to make life choices Generosity Perceptions of corruption Positive affect Negative affect
0 Afghanistan 3.594667 7.650833 0.508417 52.266667 0.518167 0.070083 0.843333 0.548667 0.326500
10 Bangladesh 4.754467 8.128600 0.607067 62.040000 0.750867 -0.032800 0.742733 0.621500 0.267533
15 Bhutan 5.196667 9.169667 0.849000 59.900000 0.824667 0.299333 0.695333 0.816000 0.284333
63 India 4.473200 8.489133 0.606867 58.320000 0.791467 0.019071 0.828467 0.686667 0.307533
90 Maldives 5.198000 9.826000 0.913000 70.600000 0.855000 0.024000 NaN NaN NaN
103 Nepal 4.689500 7.865643 0.786643 60.128571 0.675643 0.145692 0.853571 0.631357 0.269214
113 Pakistan 5.242500 8.330357 0.566286 56.721429 0.517071 0.109154 0.798500 0.620077 0.329857
138 Sri Lanka 4.308462 9.227385 0.828923 66.407692 0.812923 0.180231 0.818692 0.810077 0.216385
In [14]:
In [15]:
In [16]:
In [17]:
In [18]:
Country nameLife LadderrankPakistan5.24251.0Maldives5.19799999999999952.0Bhutan5.1966666666666663.0Bangladesh4.75446666666666754.0Nepal4.6895000000000015.0India4.47326.0Sri Lanka4.308461538461547.0Afghanistan3.5946666666666678.0
In [19]:
In [20]:
200620082010201220142016201820202.533.544.555.56
Country nameAfghanistanBangladeshBhutanIndiaMaldivesNepalPakistanSri LankayearLife Ladder
<Figure size 1080x720 with 0 Axes>
In [ ]:
In [21]:
In [22]:
In [23]:
In [24]:
Country nameSocial supportrankMaldives0.91299999999999991.0Bhutan0.84900000000000012.0Sri Lanka0.82892307692307693.0Nepal0.78664285714285734.0Bangladesh0.60706666666666685.0India0.60686666666666686.0Pakistan0.56628571428571437.0Afghanistan0.50841666666666668.0
In [25]:
200620082010201220142016201820200.40.50.60.70.80.9
Country nameAfghanistanBangladeshBhutanIndiaMaldivesNepalPakistanSri LankayearSocial support
<Figure size 1080x720 with 0 Axes>
In [26]:
In [27]:
In [28]:
In [29]:
In [30]:
Country nameLog GDP per capitarankMaldives9.8261.0Sri Lanka9.2273846153846132.0Bhutan9.1696666666666663.0India8.4891333333333334.0Pakistan8.3303571428571425.0Bangladesh8.12866.0Nepal7.86564285714285657.0Afghanistan7.6508333333333348.0
In [31]:
200620082010201220142016201820207.588.599.5
Country nameAfghanistanBangladeshBhutanIndiaMaldivesNepalPakistanSri LankayearLog GDP per capita
<Figure size 1080x720 with 0 Axes>
In [32]:
In [33]:
In [34]:
In [35]:
In [36]:
Country nameHealthy life expectancy at birthrankMaldives70.61.0Sri Lanka66.40769230769232.0Bangladesh62.0399999999999853.0Nepal60.1285714285714264.0Bhutan59.95.0India58.326.0Pakistan56.7214285714285757.0Afghanistan52.266666666666668.0
In [37]:
200620082010201220142016201820205055606570
Country nameAfghanistanBangladeshBhutanIndiaMaldivesNepalPakistanSri LankayearHealthy life expectancy at birth
<Figure size 1080x720 with 0 Axes>
In [38]:
In [39]:
In [40]:
In [41]:
In [42]:
Country nameFreedom to make life choicesrankMaldives0.8551.0Bhutan0.82466666666666682.0Sri Lanka0.81292307692307693.0India0.79146666666666674.0Bangladesh0.75086666666666665.0Nepal0.67564285714285716.0Afghanistan0.51816666666666667.0Pakistan0.51707142857142858.0
In [43]:
200620082010201220142016201820200.40.50.60.70.80.9
Country nameAfghanistanBangladeshBhutanIndiaMaldivesNepalPakistanSri LankayearFreedom to make life choices
<Figure size 1080x720 with 0 Axes>
In [44]:
In [45]:
In [46]:
In [47]:
In [48]:
Country nameGenerosityrankBhutan0.29933333333333331.0Sri Lanka0.180230769230769222.0Nepal0.145692307692307683.0Pakistan0.109153846153846164.0Afghanistan0.070083333333333345.0Maldives0.0246.0India0.0190714285714285737.0Bangladesh-0.03288.0
In [49]:
20062008201020122014201620182020−0.100.10.20.3
Country nameAfghanistanBangladeshBhutanIndiaMaldivesNepalPakistanSri LankayearGenerosity
<Figure size 1080x720 with 0 Axes>
In [50]:
In [51]:
In [52]:
In [53]:
In [54]:
Country namePerceptions of corruptionrankNepal0.85357142857142851.0Afghanistan0.84333333333333342.0India0.82846666666666673.0Sri Lanka0.81869230769230764.0Pakistan0.79855.0Bangladesh0.74273333333333356.0Bhutan0.69533333333333327.0Maldivesnannan
In [55]:
200620082010201220142016201820200.650.70.750.80.850.90.95
Country nameAfghanistanBangladeshBhutanIndiaMaldivesNepalPakistanSri LankayearPerceptions of corruption
<Figure size 1080x720 with 0 Axes>
In [56]:
In [57]:
In [58]:
In [59]:
In [60]:
Country namePositive affectrankBhutan0.81600000000000021.0Sri Lanka0.81007692307692312.0India0.68666666666666663.0Nepal0.63135714285714274.0Bangladesh0.62155.0Pakistan0.62007692307692316.0Afghanistan0.54866666666666667.0Maldivesnannan
In [61]:
200620082010201220142016201820200.40.50.60.70.8
Country nameAfghanistanBangladeshBhutanIndiaMaldivesNepalPakistanSri LankayearPositive affect
<Figure size 1080x720 with 0 Axes>
In [62]:
In [63]:
In [64]:
In [65]:
In [66]:
Country nameNegative affectrankPakistan0.32985714285714281.0Afghanistan0.326499999999999962.0India0.30753333333333343.0Bhutan0.28433333333333334.0Nepal0.269214285714285745.0Bangladesh0.267533333333333356.0Sri Lanka0.21638461538461547.0Maldivesnannan
In [67]:
200620082010201220142016201820200.150.20.250.30.350.40.450.5
Country nameAfghanistanBangladeshBhutanIndiaMaldivesNepalPakistanSri LankayearNegative affect
<Figure size 1080x720 with 0 Axes>
In [ ]: